#!/bin/bash

while read -r d; do
  [[ -d $d ]] || continue
  gio-querymodules "$d"
  rmdir --ignore-fail-on-non-empty "$d"
done
